package com.csair.finance.ehome.base.common;

import com.csair.finance.ehome.base.context.UserContext;
import com.csair.finance.ehome.base.vo.UserInfo;
//1
/**
 * @Author: wurunbin
 * @Date: 2020/3/5 11:35
 * @Description:
 **/
public class BaseController {

    protected <T> BaseResponse<T> buildSuccess(T data){
        return new BaseResponse<>(ResponseCode.SUCCESS,
                "成功",data);
    }

    protected <T> BaseResponse<T> buildError(T data){
        return new BaseResponse<>(ResponseCode.BIZ_LIMIT,
                "失败",data);
    }

    protected UserInfo getUser(){
        return UserContext.getUser();
    }

    protected String getAccount(){
        return UserContext.getUser().getAccount();
    }
}
